package 字符串.正则;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

/********* `
 * @description:
 * @author: ywk
 * @date: 2021-09-12
 */
public class 匹配邮件 {
    public static void main(String[] args) {
        String pat = "[a-z]+@([a-z]+\\.)+(edu|com)";
        Pattern pattern = Pattern.compile(pat);
        String str = "rs@cs.priceton.edu";
        Matcher matcher = pattern.matcher(str);
        System.out.println(matcher.find());
    }
}
